Helpful Information
 
 
Category: Read An Article
Update the "Who's Online" viewing location for new PHP files & Hacks

This is simple, and I apologize for it being a pathetic one...but it's useful.

Open up online.php (in your root folder), and search for this code:


case 'edit':
$userinfo[where] = "Editing Post";
break;


Place below it the following code:


case 'TITLEOFPAGE':
$userinfo[where] = "DESCRIPTION OF PAGE";
break;


MAKE SURE YOU REPLACE "TITLEOFPAGE" WITH THE NAME OF THE PAGE (JUST LETTERS; NO FANCY CHARACTERS OR SPACES) -- a good idea might be to end it with "funfun" or something so that you don't replicate an already existing title.

The "DESCRIPTION OF PAGE..." part will be what shows up in the location menu on the "Who's Online" page.

Now, to add the final altering to make the whole thing work, find:


case 'register.php':
$userinfo[activity] = 'register';
break;


After it, add:


case 'NAMEOFPHPFILE':
$userinfo[activity] = 'TITLEOFPAGE';
break;


Make sure you replace "TITLEOFPAGE" with the one you used above. Then, replace "NAMEOFPHPFILE" with the name of the file that the viewer is actually at.

I did it on my boards for "toplist.php" & "attach.php." Their codes were:


case 'toplist':
$userinfo[where] = "Forum Top Sites";
break;
case 'attach':
$userinfo[where] = "Attachment Listings";
break;


and


case 'toplist.php':
$userinfo[activity] = 'toplist';
break;
case 'attach.php':
$userinfo[activity] = 'attach';
break;


I'm going to do it for the shoutbox as well, but I think you get the idea. So, have fun.

I personally consider this more of a reference than a hack. But hey, it qaulifies. ;)

Or you can just install Firefly's "Who's Online Location via Admin CP" hack, and do all this via your Admin CP without needing to hack your online.php each time you have a new file. :)

I knew about this but it's a good idea to tell users how to do it.

Originally posted by Erwin
Or you can just install Firefly's "Who's Online Location via Admin CP" hack, and do all this via your Admin CP without needing to hack your online.php each time you have a new file. :)

I prefer hand-editing the file to tell you the truth. That way I have more control over it ;)

hand editing something like this is only 2 lines that need not be custminzed, otehr than the name, so fireflys hack is rather good even if you like to have more control.

Fireflys hack would never work for me, so ive always done it by hand.

Im in agreement with Anime-Loo. For quick and dirty and easy, say if you only have one page or so to add, this is a useful tool. Thanks!

This method is great when you need to add different names for different GET strings :)










privacy (GDPR)